home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
BOZOL2.ZIP
/
TEST.BOZ
< prev
next >
Wrap
Text File
|
1994-02-08
|
36KB
|
721 lines
goto start
====================================================================
October 21, 1993 - Erik Lee Olson, PowerBASIC Tech Support
Port Charlotte, Florida
This is a test program for BozoL. See BOZOL.DOC and BOZOL.REF for a
complete description of how to use and customize BozoL.
BozoL and the PowerBASIC interpreter source code are public domain
=====================================================================
start (this is the beginning of the program)
color 14,1:cls
locate 2,5:print "BozoL test program"
print "==================" at locate 3,5
color 15,1 print chr 7
print "1. WHAT IS BOZOL?" at locate 7,15
print "2. BOZOL COMMANDS AND FUNCTIONS - STARTER SET" at locate 8,15
print "3. BOZOL PROGRAMMING RULES" at locate 9,15
print "4. HOW TO ADD COMMANDS AND FUNCTIONS" at locate 10,15
print "5. CALLING BOZOL FROM YOUR OWN PROGRAMS" at locate 11,15
print "Or type Q to quit" at locate 13,18 in color 14,1
color 15,1:locate 15,18:input "Enter a selection --> ",Pick
if eval len pick=0: print chr 7:goto start
goto one if eval Pick=1
goto two if eval Pick=2
goto three if eval Pick=3
goto four if eval Pick=4
goto five if eval Pick=5
if same upper Pick,"Q": color 7,0: Print "Goodbye!": end
print chr 7:goto start
one:
cls with color 1,7
print " 1. WHAT IS BOZOL?"
print ""
print " BozoL (The Bozo Language) is an extremely simple interpretive"
print " language written in PowerBASIC. It is designed to be easy to"
print " use, easy to modify, and to run as fast as possible."
print ""
print " Some of the rules in BozoL may seem a bit wierd, but there is a"
print " reason for this. After writing a BASIC interpreter (EBASIC.ZIP)"
print " I discovered that the fundamental design of BASIC makes it"
print " extremely difficult to parse and interpret with any sort of"
print " reasonable speed. BozoL is purposely designed to run as fast"
print " as possible as an interpreted language."
print ""
gosub pause
print " Why BozoL?"
print ""
print " Every now and then a situation may arise where you will want to"
print " incorporate a command language into your programs. BozoL can be"
print " easily modified to do things relevant to your program's needs."
print " Suppose you have a database program and you want to allow your"
print " users to program their own custom procedures without having to"
print " go back to the original source code and add them in."
print ""
print " BozoL is a language skeleton. All of the dirty work has been"
print " done already. BozoL already contains expression parsing, program"
print " flow control, basic logic, and other fundamental building blocks"
print " of a programming language (print, input, variables, etc)."
print ""
gosub pause
print " BozoL is simple. There are not a lot of rules, punctuation, or"
print " wierd symbols in the language. It is a real beginner's language."
print ""
print " All you need to do now is add your own custom commands and key-"
print " words to the language. See section 4, " CHR 34 "How to add commands and"
print " functions" CHR 34 " for the exact details on how to do this."
print ""
gosub pause
print " Prototypes and Applications"
print ""
print " Suppose you have a library of routines that pop up boxes, print"
print " menus, display pictures, etc. You can take these routines and"
print " make BozoL commands out of them. For instance, if you have a"
print " PowerBASIC subroutine that displays a message inside a red box"
print " on the center of the screen, you can make a BozoL command which"
print " calls this subroutine. So now in BozoL you can say"
print ""
print " REDBOX " CHR 34 "press any key to continue!" CHR 34
print ""
print " and BozoL will call your subroutine. Using this technique, you"
print " can take an entire library, or many libraries, and make BozoL"
print " commands out of all of those subroutines."
print ""
gosub pause
print " I'll give you a more advanced example. Suppose you have a Power-"
print " BASIC library that features pull-down menus, dialog boxes, list"
print " boxes, a text editor, and data entry screens. If you took every"
print " callable SUB and FUNCTION in this library and made BozoL commands"
print " out of them, then you could use the BozoL language to write"
print " really neat user-interface programs, prototypes, or even finished"
print " products. Instead of shipping an EXE, you can ship the BozoL"
print " interpreter along with an interpreted BozoL program that can"
print " be easily modified by your customers without ever having to"
print " give them the source code or customizing the program yourself."
print ""
print " Software upgrades could be faxed to your customers or even"
print " dictated over the phone."
print ""
gosub pause
print " Process Control"
print ""
print " You could use BozoL to control machinery. You could add commands"
print " like TURN EVERYTHING OFF or DISPLAY STATUS OF MIXER 1. By inventing"
print " commands and adding them to the language you could turn BozoL into"
print " a high level language that does almost anything, for any purpose."
print " Users could enter direct statements or run programs that display"
print " menus and perform certain tasks, and easily add to or modify the"
print " system without a lot of complicated programming. Consider these"
print " possible additions to the language:"
print ""
print " DISPLAY SCHEMATIC"
print " BLOCK PHONES"
print " ELECTRIC FENCES OFF"
print " DISENGAGE SECURITY IN DINOSAUR EMBRYO LAB"
print ""
gosub pause
print " With the fundamental building blocks of the language already in"
print " place (like GOTO, GOSUB, IF, LOAD, RUN, SAVE, PRINT, INPUT, LOCATE,"
print " COLOR, LET, etc) you can easily build a custom language that works"
print " well, runs fast, can handle almost any programming task, and can"
print " call subroutines written in BASIC, C, Assembler, or BozoL. Since"
print " most of the nitty gritty is compiled in (like what do do when the"
print " command BLOCK PHONES is issued) it will almost always seem to"
print " run just as fast as a compiled program."
print ""
gosub pause
goto start
two:
cls with color 1,7
print " 2. BOZOL COMMANDS AND FUNCTIONS - STARTER SET"
print ""
print " As I mentioned in part 1, all of the fundamental building blocks"
print " of the language, its structure, variable handling and flow control"
print " have already been built in. All you need to do is add new key"
print " words and the code that is executed when BozoL sees the key word."
print ""
print " These are the key words that are built in to BozoL already:"
print ""
print ""
print " ASC ASCII BE CALC CASE CHR CLS"
print " COLOR CR EQUAL EQUALS EVAL FALSE GOSUB"
print " GOTO IF IN INKEY INPUT IS LCASE"
print " LEFT LEN LET LIST LOAD LOCATE LOWER"
print " LTRIM MID NOT PRINT PROMPT QUIT RETURN"
print " RIGHT RTRIM RUN SAME SAVE SET SUBSTR"
print " TAB TO TRUE UCASE UNTIL UPPER WHAT"
print " WHILE WITH"
print ""
gosub pause
print " (... and added since this writing...)"
print